import axiosInstance from "@/api/axiosInstance";
import { objectToQueryParams } from "@/utils/index"

export const getRecommendationsList = function (data) {
    const datas = objectToQueryParams(data)
    return axiosInstance.get(`/social/activity/recommend?${datas}`);
};

export const getActivityDetailInfoRequest = function (data) {
    return axiosInstance.get(`/social/activity/info?activityId=${data}`);
};

export const cancelCollectActivityRequest = function (data) {
    return axiosInstance.post(`/social/activity/cancelBookmark`, data);
};

export const hasCollectActivityRequest = function (data) {
    return axiosInstance.post(`/social/activity/bookmark`, data);
};

export const createActivityTicketRequest = function (data) {
    return  axiosInstance.post(`/social/activity/ticket/createOrder`, data);
};

export const exitActivityRequest = function (data) {
    return  axiosInstance.post(`/social/activity/exit`, data);
};

export const activityStartById = function (data) {
    return  axiosInstance.post(`/social/activity/start`, data);
};

export const activityCancelById = function (data) {
    return  axiosInstance.post(`/social/activity/cancel`, data);
};

export const createTempTicket = function (data) {
    return  axiosInstance.post(`/social/activity/ticket/createTemp`, data);
};

export const getActivityMemberLisRequest = function (data) {
    return axiosInstance.get(`/social/activity/getMember?activityId=${data}`);
};

export const getActivityAuditLisRequest = function (data) {
    return axiosInstance.get(`/social/activity/getPendingJoinReview?activityId=${data}`);
};

export const postApprovalJoinRequest = function (data) {
    return axiosInstance.post(`/social/activity/approvalJoin`, data);
};

export const postRejectJoinRequest = function (data) {
    return axiosInstance.post(`/social/activity/rejectJoin`, data);
};

export const postRefoundRequest = function (data) {
    return axiosInstance.post(`/social/activity/getPendingExitReview`, data);
};

export const postRejectMoney = function (data) {
    return axiosInstance.post(`/social/activity/rejectExit`, data);
};


export const postApprovalMoney = function (data) {
    return axiosInstance.post(`/social/activity/approvalExit`, data);
};


export const getActivityParticipantListRequest = function (data) {
    return axiosInstance.get(`/social/activity/data/participant?activityId=${data}`);
};

export const getActivityOrderListRequest = function (data) {
    return axiosInstance.get(`/social/activity/data/order?activityId=${data}`);
};

export const getSearchKeyWordListRequest = function (data) {
    const datas = objectToQueryParams(data)
    return axiosInstance.get(`/social/activity/search?${datas}`);
};

export const getSearchHistoryList = function () {
    return axiosInstance.get(`/social/searchHistory`);
};

export const cleanhistoryByRequest = function (data) {
    const datas = objectToQueryParams(data)
    return axiosInstance.post(`/social/clearSearchHistory?${datas}`);
};

export const getEditactivityByDetail = function (id) {
    return axiosInstance.get(`/social/activity/detail?activityId=${id}`);
};

export const updateActivityByDetail = function (data) {
    return axiosInstance.post(`/social/activity/modify`, data);
};

export const getMyActivityList = function (data) {
    const datas = objectToQueryParams(data)
    return axiosInstance.get(`/account/myActivity?${datas}`);
};

export const getMyCoummityGroupListByRequest = function () {
    const data = {
        myType: 2,
        current: 1,
        size: 1000,
    };
    const datas = objectToQueryParams(data)
    return axiosInstance.get(`/account/myCommunity?${datas}`);
};

